import React, { Component } from 'react'
import {Modal,Form,Input} from 'antd';

export default class EditForm extends Component {
    formRef = React.createRef();
    componentDidMount(){
        const {setFieldsValue}= this.formRef.current;
       setFieldsValue({
            smart_id:this.props.data.smart_id,
            smart_content:this.props.data.smart_content,
            smart_tag:this.props.data.smart_tag
       });
    
        
        // this.props.form.setFieldsValue(this.props.data)
    }
    render() {
 
        
        return (
            <Form ref={this.formRef}
                layout="horizontal"
                labelCol={{span:7}}//不能超过24
                wrapperCol={{span:12}}>
                
                <Form.Item name="smart_id" label='编号' >
                <Input  disabled="true " />  
                </Form.Item>
                    
                <Form.Item name="smart_tag" label='关键词' 
                    rules={[{
                            required:true,
                            message:'关键词',
                        }]}>
                <Input placeholder='关键词' />  
                </Form.Item>
                <Form.Item name="smart_content" label='内容' 
                    rules={[{
                            required:true,
                            message:'请输入内容',
                        }]}>
               <Input.TextArea allowClear showCount minRows='5' maxLength={200} />
               
                </Form.Item>
                </Form>
        )
    }
}


// {
//     pattern:/\b1[358]\d{9}\b/g,
//     message:'请输入合法的电话号码',
// },
